using System.Collections.ObjectModel;
using System.ComponentModel;

namespace Rio.Framework.Pages.Controls.Navigation
{
    public class TabViewModel : INotifyPropertyChanged
	{
		private bool isSelected;
		private string text;

		private ObservableCollection<GroupViewModel> groups;

		public TabViewModel()
		{
			groups = new ObservableCollection<GroupViewModel>();
		}

		public ObservableCollection<GroupViewModel> Groups
		{
			get
			{
				return groups;
			}
		}

        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Called when [property changed].
        /// </summary>
        /// <param name="propertyName">Name of the property.</param>
        protected void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

		public bool IsSelected
		{
			get
			{
				return this.isSelected;
			}
			set
			{
				if (this.isSelected != value)
				{
					this.isSelected = value;
					this.OnPropertyChanged("IsSelected");
				}
			}
		}

		public string Text
		{
			get
			{
				return this.text;
			}
			set
			{
				if (this.text != value)
				{
					this.text = value;
					this.OnPropertyChanged("Text");
				}
			}
		}
	}
}
